package com.chinacoal.microservice.impl.client;

import com.chinacoal.microservice.impl.client.fallback.CCIPTaskClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(value = "ccip-hr-attendance", fallback = CCIPTaskClientFallback.class)
public interface CCIPTaskClient {

    @GetMapping(value = "/hr-attendance/task/info")
    public Map<String, Object> getTaskInfo(@RequestParam("bizCode") String bizCode, @RequestParam("bizID") String bizID);

    @RequestMapping(method = RequestMethod.PUT, value = "/hr-attendance/approve/leave/{leaveId}/approvaled")
    public Map<String, Object> leaveApprove(@PathVariable("leaveId") String leaveId, @RequestBody Object record);

    @RequestMapping(method = RequestMethod.PUT, value = "/hr-attendance/approve/appeal/{explainId}/approvaled")
    public Map<String, Object> appealApprove(@PathVariable("explainId") String explainId, @RequestBody Object record);

    @RequestMapping(method = RequestMethod.PUT, value = "/hr-attendance/approve/travel/{travelId}/approvaled")
    public Map<String, Object> travelApprove(@PathVariable("travelId") String travelId, @RequestBody Object record);

    @RequestMapping(method = RequestMethod.PUT, value = "/hr-attendance/approve/leave/{leaveId}/disagree")
    public Map<String, Object> leaveApproveDisagree(@PathVariable("leaveId") String leaveId, @RequestBody Object record);

    @RequestMapping(method = RequestMethod.PUT, value = "/hr-attendance/approve/appeal/{explainId}/disagree")
    public Map<String, Object> appealApproveDisagree(@PathVariable("explainId") String explainId, @RequestBody Object record);

    @RequestMapping(method = RequestMethod.PUT, value = "/hr-attendance/approve/travel/{travelId}/disagree")
    public Map<String, Object> travelApproveDisagree(@PathVariable("travelId") String travelId, @RequestBody Object record);
}
